#ifndef PPCUSTOMERMOVIE_H_INCLUDED
#define PPCUSTOMERMOVIE_H_INCLUDED

#include <map>
#include <vector>
#include "include/ppread.h"

class ppcustomermovie{
    int size;
    //This map is the crux o all the data. We are holding
    //Per customer ratings for every movie he has rated.
    //It is a sparse matrix kind of an implementation.
    map<int, map<short, short> > mpCustomerMovieRating;
    map<short, char> getMovieIDs(int custID);
    map<short, float> mpCustSD;
    map<short, float> mpMean;
    public:
    ppcustomermovie(){};
    vector<int> getCustIDs();
    void populate(ppread moviecustomerrating);
    double findDistance(int custID1, int custID2);
    double findDistanceInteresting(int custID1, int custID2, short movieID);
    vector<int> findNearestK(map<int, double> mpCustDist, int K);
    void calculateSD();
    bool findInteresting(int nCustID, short nMovieID);
    vector<int> getCustWhoSawMovie(short MovieID);
    short getRating(int CustID, short movieID);
};

class Nlist{
    public:
    int custID;
    double distance;


    Nlist(int Id, double dist){
        custID = Id;
        distance = dist;
    }

    bool operator < (Nlist obj){
        if(distance < obj.distance){
            return true;
        }else{
            return false;
        }
    }
};

#endif // PPCUSTOMERMOVIE_H_INCLUDED
